<template>
<div class="mainDiv" style="padding: 10px; box-sizing: border-box;">
            <el-table :data="orderlist" :stripe="true" height="100%" class="mt mb" show-summary>
                <el-table-column prop="id" label="ID"></el-table-column>
                <el-table-column prop="goodsname" label="商品名称"></el-table-column>
                <el-table-column prop="num" label="数量"></el-table-column>
            </el-table>
            <el-input type="textarea" v-model="orderinfo.remarks" disabled></el-input>
            <div class="rowHead">
                <el-button size="mini" style="float: right;margin-left: 5px" type="primary" @click="onSubmit" v-show="orderinfo.status == 0" v-qx="quanxian.check">审核</el-button>
                <el-button size="mini" style="float: right;margin-left: 5px" @click="closewin">取消</el-button>
            </div>
</div>
</template>
<script>
import C from '#/src/common/common.js'

export default {
    name: 'stockOrderInfo',
    data() {
        return {
            orderinfo: {},
            orderlist: [],
            quanxian: {
                ru: 'stock_ru',
                chu: 'stock_chu',
                status: 'stock_status',
                check: 'stock_check',
                del: 'stock_del',
                look: 'stock_look',
            }
        }
    },
    methods: {
        onSubmit: async function() {
            let data = await C.ajax('/shop/stock/reviewstockorder', { id: C.getDatas().id }, 'post')
            if (data) {
                C.closeBrowserWindow(data)
            }
        },
        closewin: function() {
            C.closewin()
        }
    },
    mounted: async function() {
        let data = await C.ajax('/shop/stock/orderinfo', { id: C.getDatas().id }, 'post')
        if (data) {
            this.orderinfo = data.orderinfo
            this.orderlist = data.orderlist
        }
    }
}
</script>